﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BKH.BLL
{
    class BenhNhanBUO:IBUO<tbl_BenhNhan>
    {
        HospitalDBDataContext contex = new HospitalDBDataContext();
        public bool Insert(tbl_BenhNhan obj)
        {
            throw new NotImplementedException();
        }

        public bool Delete(int id)
        {
            throw new NotImplementedException();
        }

        public bool Delete(tbl_BenhNhan obj)
        {
            throw new NotImplementedException();
        }

        public List<tbl_BenhNhan> GetAll()
        {
            return contex.tbl_BenhNhans.ToList<tbl_BenhNhan>();
        }

        public tbl_BenhNhan GetSingle(int id)
        {
            throw new NotImplementedException();
        }

        public bool Update(int id, tbl_BenhNhan obj)
        {
            throw new NotImplementedException();
        }

        public List<tbl_BenhNhan> Search(int Id)
        {

            return contex.tbl_BenhNhans.Where(n => n.BenhNhanID == Id).ToList<tbl_BenhNhan>();
        }
        public List<tbl_BenhNhan> Search(String Name)
        {

            return contex.tbl_BenhNhans.Where(n => n.LastName.Equals(Name)).ToList<tbl_BenhNhan>();
        }

        public List<tbl_BenhNhan> SearchByCMND(String CMND)
        {

            return contex.tbl_BenhNhans.Where(n => n.CMND.Equals(CMND)).ToList<tbl_BenhNhan>();
        }
    }
}
